package com.caption.api.client.impl;
import com.caption.api.client.IDCardAuthClient;
import com.caption.api.client.base.BaseApiClient;
import com.caption.api.entity.ApiResponse;
import com.caption.api.entity.IDCarAuthCondition;
import com.caption.api.entity.IDCarAuthResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 身份认证客户端
 */
@Service
@Slf4j
public class IDCardAuthClientImpl extends BaseApiClient<ApiResponse<IDCarAuthResultDTO>,IDCarAuthCondition> implements IDCardAuthClient {

    @Override
    public ApiResponse<IDCarAuthResultDTO> call(IDCarAuthCondition condition) {
        ApiResponse<IDCarAuthResultDTO> response = super.invoke(condition);
        return response;
    }

    /**
     * 真正实现调用业务的代码
     * @param
     * @param condition
     * @return
     */
    @Override
    public ApiResponse<IDCarAuthResultDTO> execute(String interfacesId, IDCarAuthCondition condition){
        log.info("调用身份认证接口");
        IDCarAuthResultDTO idCarAuthResultDTO=new IDCarAuthResultDTO(100,"身份认证成功");
        ApiResponse apiResponse=new ApiResponse();
        apiResponse.setData(idCarAuthResultDTO);
        return apiResponse;
    }


    @Override
    public String getInterfaces(){
        return "A0001";
    }

}
